/**
 * Created by yuweimei on 2018/5/5.
 */
app.controller('liker', function($scope, $http) {
	//证书
	var token = localStorage.getItem('token');
	var userId = sessionStorage.getItem('MyUserId');
	$scope.inInt = function() {
		$http({
			method: 'get',
			url: app.netPath + '/follow/showFans',
			headers: {
				'Authorization': token
			},
			params: {
				userId: userId
			}
		}).then(function(res) {
			if(!res.data.error) {
				$scope.userInfoList = res.data.data;
				console.log($scope.userInfoList);
				for(var i = 0; i < $scope.userInfoList.length; i++) {
					//放置头像
					if(res.data.data[i].user.userAvatarAddress) {
						res.data.data[i].user.userAvatarAddress = app.netPath + '/resources/img/' + res.data.data[i].user.userAvatarAddress;
					}
				}
			} else {
				$.toast(res.data.error + ',' + res.data.msg);
			}
		}, function() {
			$.toast('网络走丢了！')
		});
	};
	// }
	//跳转otherPerson详情页
	$scope.GoToOtherUser = function(userId) {
		sessionStorage.setItem('OtherUserId', userId);
	}

});